#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
int arr[N];
int n;
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)cin >> arr[i];
	sort(arr, arr + n);
	cout << n % 2 << " ";
	LL ans = 0;
	for (int i = n / 2; i < n; i++)ans += arr[i];
	for (int i = 0; i < n / 2; i++) {
		ans -= arr[i];
	}
	cout << ans << endl;
	return 0;
}